import request from "@/utils/request";

// 查询用户换发记录列表
export function listAiChangeRecord(query) {
  return request({
    url: "/business/aiChangeRecord/list",
    method: "get",
    params: query,
  });
}
// 查询用户全部换发记录
export function getExchangeRecord(userId,query) {
  return request({
    url: "/business/aiChangeRecord/getExchangeRecord/" + userId,
    method: "get",
    params: query,
  });
}

// 查询用户换发记录详细
export function getAiChangeRecord(id) {
  return request({
    url: "/business/aiChangeRecord/" + id,
    method: "get",
  });
}

// 查询用户调用详情
export function getAiChangeList(userId) {
  return request({
    url: "/business/aiChangeRecord/aiChangeList?userId=" + userId,
    method: "get",
  });
}

// 新增用户换发记录
export function addAiChangeRecord(data) {
  return request({
    url: "/business/aiChangeRecord",
    method: "post",
    data: data,
  });
}

// 在线更换发型
export function onlineHairChangeApi(data) {
  return request({
    url: `/business/aiChangeRecord/onlineHairChange`,
    method: "post",
    data: data,
  });
}

// 修改用户换发记录
export function updateAiChangeRecord(data) {
  return request({
    url: "/business/aiChangeRecord",
    method: "put",
    data: data,
  });
}

// 删除用户换发记录
export function delAiChangeRecord(id) {
  return request({
    url: "/business/aiChangeRecord/" + id,
    method: "delete",
  });
}

// 校验用户手机号是否已注册
export function checkUserByPhoneApi(phone) {
  return request({
    url: "/system/user/checkUserByPhone?phone=" + phone,
    method: "get",
  });
}

// 查询用户补发诉求
export function queryHairstyleDemandApi(id) {
  return request({
    url: "/business/aiHairstyleDemands/queryHairstyleDemand?userId=" + id,
    method: "get",
  });
}

// 后台管理系统修改用户诉求选择图片
export function updateUserFavoriteHairstyleApi(data) {
  return request({
    url: `/business/aiChangeRecordSub/updateUserFavoriteHairstyle?userId=${data.userId}&aiChangeRecordId=${data.aiChangeRecordId}`,
    method: "post",
  });
}

// 修改补发诉求

export function updateUserDemandsApi(data) {
  return request({
    url: `/business/aiHairstyleDemands/updateUserDemands`,
    method: "post",
    data: data,
  });
}

